home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / dev / mui / bcc_src.lha / Parser / test / MyClass.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-12-28  |  1.7 KB  |  75 lines

  1. /* MyClass class */
  2.  
  3. #include "MyClass.h"
  4.  
  5. /* ---------------------------------------------- */
  6. /* BCC header. Inserted into every generated file */
  7. /* ---------------------------------------------- */
  8.  
  9. #ifndef _BCC_EVERY
  10. #define _BCC_EVERY
  11.  
  12. /* Includes necessary for every mui c code */
  13.  
  14. #include <proto/exec.h>
  15. #include <proto/muimaster.h>
  16. #include <libraries/mui.h>
  17.  
  18. #include <mui/muiextra.h>
  19.  
  20. #include <string.h>
  21.  
  22. /* defines that help adjusting to any compiler */
  23.  
  24. #ifdef _DCC
  25.     #define REG(x) __ ## x
  26.     #define ASM
  27.     #define SAVEDS __geta4
  28. #else
  29.     #define REG(x) register __ ## x
  30.  
  31.     #ifdef _STORM
  32.  
  33.             #define ASM
  34.             #define SAVEDS __saveds
  35.  
  36.     #else
  37.  
  38.         #if defined __MAXON__ || defined __GNUC__
  39.             #define ASM
  40.             #define SAVEDS
  41.         #else
  42.             #define ASM    __asm
  43.             #define SAVEDS __saveds
  44.         #endif
  45.     
  46.     #endif
  47.  
  48. #endif
  49.  
  50. #define CallSuper() DoSuperMethodA(cl, obj, msg)
  51. #define value (tag->ti_Data)
  52. #define GetData() INST_DATA(cl, obj)
  53.  
  54. #endif
  55. mMyClassMyMet( struct IClass *cl, Object *obj, Msg msg );
  56. mMyClassMUIM_AskMinMax( struct IClass *cl, Object *obj, Msg msg );
  57. mMyClassMUIM_Draw( struct IClass *cl, Object *obj, Msg msg );
  58. mMyClassOM_NEW( struct IClass *cl, Object *obj, Msg msg );
  59.  
  60. static unsigned long SAVEDS ASM MyClass_Dispatcher( REG(a0) struct IClass *cl, REG(a2) Object *obj, REG(a1) Msg msg )
  61. {
  62.     switch( msg->MethodID ) {
  63.         case MUIM_MyClass_MyMet: return mMyClassMyMet( cl, obj, msg );
  64.         case MUIM_AskMinMax: return mMyClassMUIM_AskMinMax( cl, obj, msg );
  65.         case MUIM_Draw: return mMyClassMUIM_Draw( cl, obj, msg );
  66.         case OM_NEW: return mMyClassOM_NEW( cl, obj, msg );
  67.     }
  68.     return( DoSuperMethodA( cl, obj, msg ) );
  69. }
  70.  
  71. struct MUI_CustomClass *MyClass_Create( void )
  72. {
  73.     return MUI_CreateCustomClass( NULL, MUIC_Area, NULL, sizeof( MyClassData ), MyClass_Dispatcher );
  74. }
  75.